import request from "@/utils/request";

// 查询组卷列表
export function listJuanGenerate(query) {
  return request({
    url: "/juan/juanGenerate/list",
    method: "get",
    params: query,
  });
}

// 查询组卷详细
export function getJuanGenerate(generateId) {
  return request({
    url: "/juan/juanGenerate/" + generateId,
    method: "get",
  });
}

// 新增组卷
export function addJuanGenerate(data) {
  return request({
    url: "/juan/juanGenerate",
    method: "post",
    data: data,
  });
}

// 修改组卷
export function updateJuanGenerate(data) {
  return request({
    url: "/juan/juanGenerate",
    method: "put",
    data: data,
  });
}

// 删除组卷
export function delJuanGenerate(generateId) {
  return request({
    url: "/juan/juanGenerate/" + generateId,
    method: "delete",
  });
}

// 根据题库查询题型
export function queryQuestionCountProportions(query) {
  return request({
    url: "/juan/juanGenerate/queryQuestionCountProportions",
    method: "get",
    params: query,
  });
}

// 根据试卷查询题型
export function queryPapersQuestionCountProportions(ids) {
  return request({
    url: "/juan/juanGenerate/queryPapersQuestionCountProportions/" + ids,
    method: "get",
  });
}

// 自动组卷
export function autoGeneratePaper(query) {
  return request({
    url: "/juan/juanGenerate/autoGeneratePaper",
    method: "get",
    params: query,
  });
}

// 根据试卷ids查询试卷名称
export function queryPaperNamesByIds(ids) {
  return request({
    url: "/juan/juanPaper/queryPaperNamesByIds/" + ids,
    method: "get",
  });
}
